#!/usr/bin/python3
import time

import pymysql

# 打开数据库连接

dm_db = pymysql.connect(host="rm-bp1niy92t823g9pwww.mysql.rds.aliyuncs.com", port=3306,user="ykj-qq-test",passwd="abcdefg",database="dm_gjw")
dm_cur = dm_db.cursor()

print("==============" + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + "===================")
for o in range(1,10000):
    print("|||||||||||||  " + str(o) + "   ||||||||||||||||")
    print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
    sql = """
    INSERT INTO `goods`(`name`, `price`, `pic`, `month`)
    VALUES
    """
    for i in range(1, 100):
        if i == 99:
            sql += "('shuangkou', 552.22, 'url1', NULL);"
        else:
            sql += "('shuangkou', 552.22, 'url1', NULL),"
    res = dm_cur.execute(sql)
    dm_db.commit()
    print(res)
print("*****************" + time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + "*************")



